program eva;
type p=record
       no:integer;
       s:real;
       price:real;
       nexts:real;
       end;
var d1,d2,c,maxs,min,reian:real;
    pp:array[0..100] of p;
    gd:p;
    n,i,k:integer;
    nosolution:boolean;
function rei(h:integer):real;
var j:integer;
    onemax,m:real;
begin
   onemax:=0;
   if pp[h].s+maxs         begin
          rei:=0;
          exit;
        end;
      m:=pp[h].s;
      for j:=0 to n do
        begin
          if (pp[j].no<=pp[h].no)and(pp[j].s+maxs>m) then
            begin
              if pp[j].s+maxs>=pp[h].nexts then
                begin
                  onemax:=onemax+(pp[h].nexts-m)/d2*pp[j].price;
                  break;
                end
              else
                begin
                  onemax:=onemax+(pp[j].s+maxs-m)/d2*pp[j].price;
                  m:=pp[j].s+maxs
                end;
            end;
        end;
   rei:=onemax;
end;
begin
  min:=0;
  pp[0].no:=0;
  pp[0].s:=0;
  readln(d1,c,d2,pp[0].price,n);
  pp[n+1].s:=d1;
  for i:=1 to n do
    readln(pp[i].no,pp[i].s,pp[i].price);
  for i:=0 to n do
     pp[i].nexts:=pp[i+1].s;
  for i:=0 to n do
    for k:=i+1 to n do
      if pp[i].price>pp[k].price then
         begin
           gd:=pp[i];
           pp[i]:=pp[k];
           pp[k]:=gd;
         end;
  maxs:=d2*c;
  nosolution:=false;
  for i:=0 to n do
    begin
      reian:=rei(i);
      if reian=0 then
        begin
         writeln('No solution');
         nosolution:=true;
         break;
        end
      else
        min:=min+rei(i);
    end;
  if not nosolution then
    begin
      writeln(min:0:2);
    end;
end.
